import Home from '../pages/home/index.vue'
import Search from '../pages/search/index.vue'
import Login from '../pages/login/index.vue'
import Register from '../pages/register/index.vue'
import Detail from '../pages/Detail/index.vue'
import AddCartSuccess from '../pages/AddCartSuccess/index.vue'
import ShopCart from '../pages/ShopCart/index.vue'
import Trade from '../pages/Trade/index.vue'
import Pay from '../pages/Pay/index.vue'
import PaySuccess from '../pages/PaySuccess'
import Center from '../pages/Center'

// 配置路由规则
const routes=[
    {
        // 配置起始展示路由
        path:'/',
        component:Home,
        meta:{show:true,show2:false}
    },
    {
        path:"/home",//浏览器显示的路径
        name:'home',
        component:Home,//展示的组件
        meta:{show:true,show2:false}//配置路由源信息--控制显示组件--show配置是否显示footer组件，show2配置三级分类
    },
    {
        name:'search2',
        path:"/search/:keyword?",//配置params占位符
        component:Search,
        meta:{show:true,show2:true}
    },
    {
        path:"/login",
        component:Login,
        meta:{show:false}
    },
    {
        path:"/register",
        component:Register,
        meta:{show:false}
    },
    {
        path:"/detail/:gid",
        name:'detail',
        component:Detail,
        meta:{show:true,show2:true},
    },
    {
        name:'addcart',
        path:"/addcartsuccess",
        component:AddCartSuccess,
        meta:{show:true}
    },
    {
        path:"/shopcart",
        name:'shopcart',
        component:ShopCart,
        meta:{show:true}
    },
    {
        path:"/trade",
        name:'trade',
        component:Trade,
        meta:{show:true}
    },
    {
        path:"/pay",
        name:'pay',
        component:Pay,
        meta:{show:true}
    },
    {
        path:"/paysuccess",
        name:'paysuccess',
        component:PaySuccess,
        meta:{show:true}
    },
    {
        path:"/center",
        name:'center',
        component:Center,
        meta:{show:true}
    },
]
export default routes